//
//  degreePickerDataSource.swift
//  万才信息App
//
//  Created by 陌上互联  on 16/7/18.
//  Copyright © 2016年 万才信息. All rights reserved.
//

import UIKit

class degreePickerDataSourceAndDelegate:NSObject,UIPickerViewDataSource,UIPickerViewDelegate{
    
    var degreeData=[(Int,String)]()
    
    override init() {
        super.init()
        for (key,value) in enumUtil.RESUME_DEGREE{
            degreeData.append((key,value))
        }
    }
    
//    列的数量
    func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int {
        return 1
    }
    
//    每列的行的数量
    func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
        return enumUtil.RESUME_DEGREE.count
    }
    
//    返回对应的字符串
    func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
        return degreeData[row].1
    }
    
//    选中某个行或列的时候调用
    func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
        
    }
}